﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/PBOAMasterPage.master"
  AutoEventWireup="true" CodeFile="ReceivedBox.aspx.cs" Inherits="MsgMng_ReceivedBox" %>

<%@ Import Namespace="PBOffice.BLL" %>
<%@ Import Namespace="PBOffice.DAL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
  <style>
    .tablestyle { }
    .tablestyle td, .tablestyle th { border: solid #C8DDEF 1px; }
    .tablestyle .rowstyle { }
    .tablestyle .rowstyle:hover { background-color: #DDEAF5;}
    .tablestyle .bold { font-weight: bold; }
    .tablestyle .hand{ cursor:pointer;}
  </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
  <uc:Navigator ID="Navigator1" runat="server" Text="收件箱" />
  <asp:CheckBox ID="cbAll" runat="server" Text="全选" AutoPostBack="True" OnCheckedChanged="cbAll_CheckedChanged" />
  <asp:GridView ID="gvReceivedBox" runat="server" AutoGenerateColumns="False" CssClass="tablestyle"
    HorizontalAlign="Center" Width="100%" DataSourceID="odsReceivedMessages">
    <AlternatingRowStyle CssClass="alterrow rowstyle" />
    <Columns>
      <asp:TemplateField HeaderText="删除(√)">
        <ItemTemplate>
          <asp:CheckBox ID="cbDel" runat="server" />
          <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("MessNo") %>' />
        </ItemTemplate>
        <HeaderStyle Width="70px" />
        <ItemStyle HorizontalAlign="Center" />
      </asp:TemplateField>
      <asp:BoundField HeaderText="发件人" DataField="sender" />
      <asp:TemplateField HeaderText="主题">
        <ItemTemplate>
          <asp:Label ID="lTitle" runat="server" Text='<%# Eval("MessTitle") %>' CssClass='<%# new MsgMngBLL().IsMessageRead(((User)Session["userManage"]).UserNo,(int)Eval("MessNo"))?"hand":"bold hand"  %>' onclick='<%# "window.showModalDialog(\"MailDetail.aspx?act=read&id="+Eval("MessNo")+"\");" %>'></asp:Label>
        </ItemTemplate>
      </asp:TemplateField>
      <asp:BoundField HeaderText="发送时间" DataField="MessCreateTime" />
      <asp:BoundField HeaderText="紧急程度" DataField="MessageTypeId" />
    </Columns>
    <HeaderStyle BackColor="#66CCFE" Font-Bold="True" ForeColor="White" />
    <RowStyle CssClass="rowstyle" />
  </asp:GridView>
  <asp:ObjectDataSource ID="odsReceivedMessages" runat="server" SelectMethod="GetReceivedMessages"
    TypeName="PBOffice.BLL.MsgMngBLL">
    <SelectParameters>
      <asp:SessionParameter Name="user" SessionField="userManage" Type="Object" />
    </SelectParameters>
  </asp:ObjectDataSource>
  <asp:Button ID="bDelete" runat="server" Text="删除选定项" onclick="bDelete_Click" />
  <asp:Button ID="bReturn" runat="server" PostBackUrl="~/MsgMng/EmailBox.aspx" Text="返回" />
</asp:Content>
